import { request } from '@/utils/request';

// 根据订单id和类型获取流程实例id
export function getProcessInstanceIdByOrderIdAndType(params: Record<string, any>) {
  return request.get({
    url: '/bpm/oa-examine/query-by-orderid-and-type',
    params,
  });
}

// 获取流程实例
export function getProcessInstance(params: Record<string, any>) {
  return request.get({
    url: '/bpm/process-instance/get',
    params,
  });
}
// 获取OA 订单业务流程
export function getOAExamine(params: Record<string, any>) {
  return request.get({
    url: '/bpm/oa-examine/get',
    params,
  });
}
// 获得指定流程实例的任务列表
export function getProcessInstanceTaskList(params: Record<string, any>) {
  return request.get({
    url: '/bpm/task/list-by-process-instance-id',
    params,
  });
}

// 通过审批
export function passApprove(data: Record<string, any>) {
  return request.put({
    url: '/bpm/task/approve',
    data,
  });
}

// 拒绝审批
export function rejectApprove(data: Record<string, any>) {
  return request.put({
    url: '/bpm/task/reject',
    data,
  });
}

// 转设计延期
export function transformDesignExtension(data: Record<string, any>) {
  return request.post({
    url: '/system/order/design-extension',
    data,
  });
}

// 申请废单
export function applyAbandonedOrder(data: Record<string, any>) {
  return request.post({
    url: '/system/order/apply-delete',
    data,
  });
}
